<template>
	<view class="coupon-content">
		<scroll-view :scroll-y="true" class="list">
			<view class="li" v-for="(item,index) in list" :key="item.id" @click="choose(index)">
				<view class="left">
					<view class="count"><text>￥</text>{{item.money}}</view>
					<view class="txt">优惠券</view>
				</view>
				<view class="right">
					<view class="title">{{item.money}}元优惠券</view>
					<view class="type">
						全场通用
					</view>
					<view class="time">领取后48小时内有效</view>
				</view>
			</view>
		</scroll-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: []
			}
		},
		mounted() {
			this.getData()
		},
		methods: {
			getData() {
				const _this = this
				this.req({
					url: "/v1/box/MyCoupon",
					data: {

					},
					Loading: true,
					success: (res) => {
						if (res.code == 200) {
							_this.list = res.data
						}
					},
				});

			}
		}
	}
</script>

<style lang="scss" scoped>
	.coupon-content {
		width: 100vw;
		height: 100vh;
		background-color: #fff;
		padding-top: 40rpx;

		.list {
			width: 100%;
			height: calc(100% - 100rpx);
			position: relative;
			z-index: 3;

			.li {
				width: 90%;
				border-radius: 20rpx;
				background-color: #fff;
				display: flex;
				justify-content: space-between;
				align-items: center;
				padding: 20rpx 30rpx;
				box-sizing: border-box;
				margin-bottom: 40rpx;
				box-shadow: 0 0 15rpx #aaa;
				margin-left: 5%;

				.left {
					width: 35%;
					border-right: 1rpx dashed #ddd;
					color: #da250f;
					text-align: center;

					.count {
						font-size: 44rpx;
						font-weight: bold;

						text {
							font-size: 26rpx;
						}
					}

					.txt {
						font-size: 24rpx;
						margin-top: 10rpx;
					}
				}

				.right {
					width: 65%;
					padding-left: 20rpx;
					box-sizing: border-box;

					.title {
						font-size: 28rpx;
						color: #000;
					}

					.type {
						width: 100rpx;
						margin: 10rpx 0;
						display: flex;
						align-items: center;
						justify-content: center;
						border-radius: 30rpx;
						border: 1rpx solid #d09069;
						color: #d09069;
						padding: 0rpx 10rpx;
						font-size: 20rpx;
					}

					.time {
						color: #999;
						font-size: 24rpx;
					}
				}
			}
		}
	}
</style>